package com.fanqwz.kotlinmvvm.data.web.iface

import com.fanqwz.kotlinmvvm.data.web.RequestTemplate
import com.fanqwz.kotlinmvvm.data.web.ResponseTemplate
import com.fanqwz.kotlinmvvm.data.web.entity.LoginRequestBody
import com.fanqwz.kotlinmvvm.data.web.entity.UserEntity
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.Headers
import retrofit2.http.POST

/**
 * Created by fanqwz on 2017/10/25.
 */
interface Backend {
    companion object {
        val BASE_URL: String =
//                if (BuildConfig.DEBUG)
//                    "http://10.8.11.131:8080/"
//                else
                    "http://180.166.220.29:8081/"
    }

    @Headers("Content-Type: application/json")
    @POST("openserver/api")
    fun login(@Body user: RequestTemplate<LoginRequestBody>): Call<ResponseTemplate<UserEntity>>

}